Carbon


SIInterruptProcPtr

Header: Sound.h Carbon status: Supported

Defines a pointer to a sound input interrupt callback. Your sound input interrupt function is called by the Sound Manager when the driver’s internal buffers are full.

typedef void(* SIInterruptProcPtr) (
     inParamPtr, 
    Ptr dataBuffer, 
    SInt16 peakAmplitude, 
    SInt32 sampleSize
);

You would declare your function like this if you were to name it MySIInterruptCallback:

void MySIInterruptCallback (
     inParamPtr, 
    Ptr dataBuffer, 
    SInt16 peakAmplitude, 
    SInt32 sampleSize
);
DISCUSSION

You can specify a sound input interrupt function in the interruptRoutine field of the sound input parameter block that your application uses to initiate asynchronous recording directly from a device. Because the SPBRecordToFile function uses sound input interrupt functions to enable it to record sound data to disk during recording, you can use sound input interrupt functions only with the SPBRecord function.

A sound input device driver executes the sound input interrupt function associated with an asynchronous sound recording whenever the driver’s internal buffers are full.

The internal buffers contain raw samples taken directly from the input device. The interrupt function can thus modify the samples in the buffer in any way it requires. After your sound input interrupt function finishes processing the data, the sound input device driver compresses the data (if compression is enabled) and copies the data into your application’s buffer.

SPECIAL CONSIDERATIONS

If your sound input interrupt function accesses your application’s global variables, it must ensure that the A5 register contains the address of the boundary between the application global variables and the application parameters. Your application can pass the value of the A5 register to the sound input interrupt function in the userLong field of the sound input parameter block.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)